var version = '';
var platform = '';
// #ifdef H5  
version = '1.0.0';
platform = 'H5';
// #endif
// #ifdef APP-PLUS
version = plus.runtime.version;
platform = 'APP';
// #endif 
function getDate(type) {
	const date = new Date();

	let year = date.getFullYear();
	let month = date.getMonth() + 1;
	let day = date.getDate();

	if (type === 'start') {
		year = year - 60;
	}
	month = month > 9 ? month : '0' + month;;
	day = day > 9 ? day : '0' + day;

	return `${year}-${month}-${day}`;
}
function currentYear () {
	return new Date().getFullYear();
}
var getDay = function (date) {
	if (!date) {
		return '';
	}
	return '周' + ['日','一','二','三','四','五','六'][new Date(date).getDay()];
};
function sum(arr) {
	return arr.reduce(function(prev, curr){
		return prev + curr;
	});
}
export default {
	version,
  platform,
  sum,
	today: getDate(),
	currentYear: currentYear(),
	getDay,
	APIURL: 'http://api.shop.coins32.cn/api/'
}